package cn.iocoder.yudao.module.crossborder.platform.controller.admin.platformapilog.vo;

import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 跨境电商平台API调用日志分页 Request VO")
@Data
public class PlatformApiLogPageReqVO extends PageParam {

    @Schema(description = "平台编号", example = "9137")
    private Long platformId;

    @Schema(description = "店铺编号", example = "14369")
    private Long storeId;

    @Schema(description = "API配置编号", example = "21190")
    private Long apiConfigId;

    @Schema(description = "同步任务编号", example = "10491")
    private Long syncTaskId;

    @Schema(description = "链路追踪编号", example = "19304")
    private String traceId;

    @Schema(description = "API类型", example = "2")
    private String apiType;

    @Schema(description = "API名称", example = "张三")
    private String apiName;

    @Schema(description = "API端点")
    private String apiEndpoint;

    @Schema(description = "HTTP方法")
    private String httpMethod;

    @Schema(description = "请求头")
    private String requestHeaders;

    @Schema(description = "请求参数")
    private String requestParams;

    @Schema(description = "请求体")
    private String requestBody;

    @Schema(description = "响应状态码", example = "1")
    private Integer responseStatus;

    @Schema(description = "响应头")
    private String responseHeaders;

    @Schema(description = "响应体")
    private String responseBody;

    @Schema(description = "开始时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] startTime;

    @Schema(description = "结束时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] endTime;

    @Schema(description = "执行时长（毫秒）")
    private Integer duration;

    @Schema(description = "是否成功")
    private Boolean success;

    @Schema(description = "错误代码")
    private String errorCode;

    @Schema(description = "错误信息")
    private String errorMsg;

    @Schema(description = "重试次数", example = "28756")
    private Integer retryCount;

    @Schema(description = "用户IP")
    private String userIp;

    @Schema(description = "用户代理")
    private String userAgent;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

}